def method(a):
    # 记录存在
    d = {}
    for x in a:
        if x not in d:
            d[x] = 1
    # 判断排列
    is_pl = True
    for i in range(1, len(a) + 1): # [1, len]
        if i not in d:
            is_pl = False 
            break
    # 破坏排列吗
    if is_pl:
        return f'{1}\n1 {a[2]}'
    else:
        return 0

_ = int(input())
a = [int(x) for x in input().split(' ')]
r = method(a)
print(r)
